<template>
  <div>
    <div>
      <van-row>
        <van-col span="8"><van-icon name="arrow-left" /></van-col>
        <van-col span="8">编辑</van-col>
        <van-col span="8" class="box"
          ><img src="../assets/我的客户/系统功能.png" alt=""
        /></van-col>
      </van-row>
      <van-cell-group>
        <van-field v-model="valuekhmc" label="客户名称" />
        <van-field v-model="tellxfs" type="tel" label="联系方式" />
      </van-cell-group>
      <van-cell-group>
        <van-field v-model="valuexl" label="学历" />
        <van-field v-model="valuenl" label="年龄" />
        <van-field v-model="valuexb" label="性别" />
        <van-field v-model="valuesscs" label="所属城市" />
        <van-field v-model="valuegsmc" label="公司名称" />
        <van-field v-model="valuezw" label="职务" />
      </van-cell-group>
      <div class="app">
        <van-button round type="info" @click="add">确定修改</van-button>
      </div>
    </div>
  </div>
</template>

<script>
import { CustxgzlData,CustidData } from "../request/api";
export default {
  data() {
    return {
      valuekhmc: "",
      tellxfs: "",
      valuexl: "",
      valuenl: "",
      valuexb: "",
      valuesscs: "",
      valuegsmc: "",
      valuezw: "",
      id:this.$route.query.id
    };
  },
    created(){
         CustidData({
      id:this.$route.query.id
    }).then(res=>(
        
      console.log(res,111)
    ))
    },
  methods: {
    add() {
      CustxgzlData({
        id: this.id,
        custName: this.valuekhmc,
        cityName: this.valuesscs,
        company: this.valuegsmc,
        position: this.valuezw,
        telephone: this.tellxfs,
        education: this.valuexl,
        sex: this.valuexb,
        age: this.valuenl,
      }).then((res) => {
        console.log(res);
      });
    },
  },
};
</script>
 
<style lang = "less" scoped>
.van-row {
  padding: 20px;
  background-color: blue;
  .box {
    text-align: right;
  }
  img {
    width: 30px;
    height: 30px;
  }
}
.van-cell-group {
  margin-bottom: 10px;
}
.app {
  padding-left: 30px;
  .van-button {
    width: 90%;
    height: 50px;
    line-height: 50px;
    text-align: center;
  }
}
</style>